#include <bits/stdc++.h>

using namespace std;

#define int long long

int n , k;
priority_queue<int> heap;

signed main()
{
    cin >> n >> k;
    int sum = 0 , x;
    while(n--)
    {
        cin >> x;
        sum += x;
        if(x % 2 == 0) heap.push(x);
    }
    while(heap.size() && k--)
    {
        int t = heap.top() / 2;
        heap.pop();
        sum -= t;
        if(t % 2 == 0) heap.push(t);
    }
    cout << sum << endl;
    return 0;
}